<?

require_once ("application.list.inc");

global $_GLOBAL_DBH;
global $_OBJECT_IFACE_PANEL;
global $_IFACE_CONTROL_OBJECT;
global $_SET_TABBING;

$fs_local_document = $_SERVER["PHP_SELF"];

$lc_ass_tra_employees = array (
	first=>array (label=>"First Name",order=>"DEFAULT",wrapper=>"vmc_icon_employee"),
	last=>array (label=>"Last Name",alias=>"status",order=>"DEFAULT"),
	title=>array (label=>"Title",alias=>"employee",order=>"DEFAULT"),
	phone_1=>array (label=>"Phone",order=>"DEFAULT",
			callback=>"_template_list_substring",length=>16),
	office_location=>array (label=>"Office Location",order=>"DEFAULT",
			callback=>"_template_list_substring",length=>16),
);

$link_options_path = array (
	array (
		fs_tab=>"ass_tra_employees",
		fs_tab_option=>"lc_ass_tra_employees",
	)
);

$link_options = _app_create_tabbing (null, $link_options_path);

$object_ctl_path = array (
	array (
		fs_action=>"view",
		fs_tab=>"ass_tra_employees",
		fs_tab_option=>"fs_ass_tra_employees"
	)
);

$object_ctl = _app_create_tabbing ( "{$fs_local_document}?",
		$object_ctl_path) . "&";

$list_options_path = array (
	array (
		fs_tab=>"ass_tra_employees",
		fs_action=>"addnew",
		fs_tab_option=>"fs_ass_tra_employees"
	)
);
		
$list_options = array (
	array (
		label=>"Add An Asset",
		link=>_app_create_tabbing ("{$fs_local_document}?",$list_options_path)
	),
);

$_OBJECT_IFACE_LIST = _app_create_list_object (array (
                db_conn=>$_GLOBAL_DBH,
                indexes=>$lc_ass_tra_employees,
		list_count=>"SELECT (*) FROM ass_tra_employees,ass_tra_employee_entry WHERE ass_tra_employees.id=ass_tra_employee_entry.employee_id GROUP BY employee_id",
		list_select=>"SELECT ass_tra_employees.* FROM ass_tra_employees,ass_tra_employee_entry WHERE ass_tra_employees.id=ass_tra_employee_entry.employee_id GROUP BY employee_id",
                list_id=>"lc_ass_tra_employees",
                list_options=>$list_options,
                primary_key=>"id",
                primary_relation=>"employee_id",
                link_options=>$link_options,
                object_ctl=>$object_ctl
));


if (($_REQUEST["fs_tab"] == "ass_tra_employees") &&
		($_REQUEST["fs_tab_option"] == "fs_ass_tra_employees") &&
		($_REQUEST["employee_id"] > 0))
	$_SET_TABBING = true;

array_push ($_IFACE_CONTROL_OBJECT, $_OBJECT_IFACE_LIST);

?>
